package log.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;
@Entity
@Table(name = "log_controller")
public class LogForController {
	private String id;
	private String appname;
	private String modelname;
	private String functionname;
	private String classname;
	private String methodname;
	private String opercation;
	private Date date = new Date();
	private String ip;
	private String username;
	private String browser;
	private String os;
	private String userId;
	private String agent;
	private String uri;
	private Boolean isError = false;
	private Boolean isMenu = false;
	private String menuName;

	public LogForController() {
	}

	public LogForController(String appname, String modelname, String functionname, String classname, String methodname,
			String opercation, String ip, String username, String browser, String os, String userId, String agent,
			String uri, Boolean isError, Boolean isMenu, String menuName) {
		this.appname = appname;
		this.modelname = modelname;
		this.functionname = functionname;
		this.classname = classname;
		this.methodname = methodname;
		this.opercation = opercation;
		this.ip = ip;
		this.username = username;
		this.browser = browser;
		this.os = os;
		this.userId = userId;
		this.agent = agent;
		this.uri = uri;
		this.isError = isError;
		this.isMenu = isMenu;
		this.menuName = menuName;
	}

	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "ID", unique = true, nullable = false, length = 32)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "app_name", length = 16)
	public String getAppname() {
		return appname;
	}

	public void setAppname(String appname) {
		this.appname = appname;
	}

	@Column(name = "model_name", length = 16)
	public String getModelname() {
		return modelname;
	}

	public void setModelname(String modelname) {
		this.modelname = modelname;
	}

	@Column(name = "function_name", length = 16)
	public String getFunctionname() {
		return functionname;
	}

	public void setFunctionname(String functionname) {
		this.functionname = functionname;
	}

	@Column(name = "agent", length = 600)
	public String getAgent() {
		return agent;
	}

	public void setAgent(String agent) {
		this.agent = agent;
	}

	@Column(name = "class_name", length = 80)
	public String getClassname() {
		return classname;
	}

	public void setClassname(String classname) {
		this.classname = classname;
	}

	@Column(name = "method_name", length = 80)
	public String getMethodname() {
		return methodname;
	}

	public void setMethodname(String methodname) {
		this.methodname = methodname;
	}

	@Column(name = "opercation", length = 80)
	public String getOpercation() {
		return opercation;
	}

	public void setOpercation(String opercation) {
		this.opercation = opercation;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "date")
	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	@Column(name = "ip", length = 40)
	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	@Column(name = "username", length = 20)
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name = "browser", length = 20)
	public String getBrowser() {
		return browser;
	}

	public void setBrowser(String browser) {
		this.browser = browser;
	}

	@Column(name = "os", length = 20)
	public String getOs() {
		return os;
	}

	public void setOs(String os) {
		this.os = os;
	}

	@Column(name = "userId", length = 32)
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	@Column(name = "uri", length = 100)
	public String getUri() {
		return uri;
	}

	public void setUri(String uri) {
		this.uri = uri;
	}

	@Column(name = "isError")
	public Boolean getIsError() {
		return isError;
	}

	public void setIsError(Boolean isError) {
		this.isError = isError;
	}

	@Column(name = "isMenu")
	public Boolean getIsMenu() {
		return isMenu;
	}

	public void setIsMenu(Boolean isMenu) {
		this.isMenu = isMenu;
	}

	@Column(name = "menuName", length = 100)
	public String getMenuName() {
		return menuName;
	}

	public void setMenuName(String menuName) {
		this.menuName = menuName;
	}

}
